package com.sgb.kjwl.repository.impl;

import com.sgb.kjwl.model.api.ApiSource;
import com.sgb.kjwl.model.entity.PickDeviceEntity;
import com.swgk.core.base.model.entity.ListResponse;
import com.sgb.kjwl.repository.PickProjectRepertory;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import java.util.List;

import io.reactivex.Observable;

public class PickProjectRepertoryImpl extends BaseRepertoryImpl implements PickProjectRepertory {

    private final ApiSource apiSource;

    public PickProjectRepertoryImpl(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        super(apiSource, preferenceSource);
        this.apiSource = (ApiSource) apiSource;
    }

    @Override
    public Observable<BaseEntity<ListResponse<List<PickDeviceEntity>>>> getPickBid(String no, String projectNo, int size, int num) {
        return apiSource.getPickBid(no, projectNo, size, num).compose(this.<BaseEntity<ListResponse<List<PickDeviceEntity>>>>rxSchedulerHelper());
    }
}
